Skip to content

ublk: fix maple tree lockdep warning and unpin under spinlock#761

Open
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1084082=>linus-master
Open

ublk: fix maple tree lockdep warning and unpin under spinlock#761
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1084082=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented Apr 22, 2026

Pull request for series with
subject: ublk: fix maple tree lockdep warning and unpin under spinlock
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1084082

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 22, 2026

Upstream branch: b4e0758
series: https://patchwork.kernel.org/project/linux-block/list/?series=1084082
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 22, 2026

Upstream branch: b4e0758
series: https://patchwork.kernel.org/project/linux-block/list/?series=1084082
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1084082=>linus-master branch from 29106ab to e52ee42 Compare April 22, 2026 02:07
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from ceec5ed to 3b54e52 Compare April 22, 2026 20:20
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 22, 2026

Upstream branch: 6596a02
series: https://patchwork.kernel.org/project/linux-block/list/?series=1084082
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1084082=>linus-master branch from e52ee42 to 284fd53 Compare April 22, 2026 20:23
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 3b54e52 to 6a0b974 Compare April 23, 2026 16:58
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 23, 2026

Upstream branch: 507bd4b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1084082
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1084082=>linus-master branch from 284fd53 to f10327f Compare April 23, 2026 17:01
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 6a0b974 to 59ca59b Compare April 24, 2026 00:56
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 24, 2026

Upstream branch: dd6c438
series: https://patchwork.kernel.org/project/linux-block/list/?series=1084082
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1084082=>linus-master branch from f10327f to 3096280 Compare April 24, 2026 00:58
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from 94f0438 to 857ada9 Compare April 24, 2026 07:54
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 24, 2026

Upstream branch: dd6c438
series: https://patchwork.kernel.org/project/linux-block/list/?series=1084082
version: 1

Fix two issues in the shmem buffer maple tree usage:

1) ublk_buf_cleanup() iterates the tree with mas_for_each() without
   holding rcu_read_lock or mas_lock, triggering a lockdep splat on
   CONFIG_PROVE_RCU kernels. Add mas_lock/unlock around the iteration.

2) __ublk_ctrl_unreg_buf() calls unpin_user_pages() under mas_lock
   (a spinlock). unpin_user_pages can be expensive for large buffers
   and may take additional locks if folio refcount drops to zero.
   Restructure to drop mas_lock before unpinning, re-acquiring it
   to continue iteration.

Both functions now use the same pattern: erase under lock, drop lock,
unpin and free, re-lock to continue. Extract ublk_unpin_range_pages()
helper to share the page unpinning loop.

Reported-by: Jens Axboe <[email protected]>
Closes: https://lore.kernel.org/linux-block/[email protected]/
Cc: Liam R. Howlett <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Tested-by: Shin'ichiro Kawasaki <[email protected]>
@blktests-ci blktests-ci Bot force-pushed the series/1084082=>linus-master branch from 3096280 to 01132e6 Compare April 24, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants